def hanoi(n, from, assist, to)
  if n == 1
    move(from, to)
  else
    hanoi(n-1, from, to, assist)
    move(from, to)
    hanoi(n-1, assist, to, from)
  end
end

def move(a, b)
  puts "#{a}->#{b}"
end

hanoi(3, 'A', 'B', 'C')